<script setup lang="ts">
import { ref, defineProps, defineEmits } from "vue";
import Vcode from "vue3-puzzle-vcode";

const props = defineProps<{
  label?: string
}>()

const isShow = ref(false);
const onShow = () => {
  isShow.value = true;
};

const onClose = () => {
  isShow.value = false;
};

const onSuccess = () => {
  onClose(); // 验证成功，手动关闭模态框
};

const onError = () => {

}
</script>

<template>
  <Vcode :show="isShow" @success="onSuccess" @close="onClose" />
  <a-button type="primary" @click="onShow" style="margin: 0;">{{props.label || '开始验证'}}</a-button>
</template>

<style scoped lang="scss">

</style>